package com.treasure.service.commons.exception;

import com.treasure.service.enums.CodeEnum;

/** 
* @ClassName    : TaoXunException
* @author       : panxingwu
* @date         : 2018年6月9日 下午12:04:08
* @Description  : 自定义异常
*/
public class BusinessException extends Exception {
	private static final long serialVersionUID = -136033331750497021L;
	private String code;
	private String message;
	private Object object;
	public BusinessException(String code, String message, Object object) {
		this.code = code;
		this.message = message;
		this.object = object;
	}
	public BusinessException(CodeEnum codeEnum, Object object) {
		this.code = codeEnum.getCode();
		this.message = codeEnum.getDesc();
		this.object = object;
	}
	public BusinessException(CodeEnum codeEnum) {
		this.code = codeEnum.getCode();
		this.message = codeEnum.getDesc();
	}
	public BusinessException(String code, String message) {
		this.code = code;
		this.message = message;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public Object getObject() {
		return object;
	}
	public void setObject(Object object) {
		this.object = object;
	}
}
